SDK Types Reference
The xpander.ai SDK uses various data types, enumerations, and models across its modules. This reference provides comprehensive documentation for all shared types.Enumerations
AgentExecutionStatus
Enumeration of task execution statuses used throughout the Tasks and Agents modules.
Pending
: Task is queued and waiting to startExecuting
: Task is currently being executedPaused
: Task execution is temporarily pausedError
: Task encountered an error during executionFailed
: Task execution failed to complete successfullyCompleted
: Task finished successfullyStopped
: Task was manually stopped
OutputFormat
Enumeration of supported output formats for task results.
Text
: Plain text outputJson
: JSON-formatted outputMarkdown
: Markdown-formatted outputHtml
: HTML-formatted output
TaskUpdateEventType
Enumeration of task event types for real-time streaming.
TaskCreated
: Task was createdTaskUpdated
: Task status or data was updatedTaskFinished
: Task execution completedToolCallRequest
: Agent is requesting to use a toolToolCallResult
: Tool execution result is availableSubAgentTrigger
: A sub-agent is triggered during execution
Data Models
AgentExecutionInput
Input configuration for task execution.
text
(Optional[str]): The main prompt or instruction textfiles
(Optional[List[str]]): URLs of files to process with the taskuser
(Optional[User]): User details associated with task execution
text
or files
must be provided (validated automatically).
TaskUpdateEvent
Real-time event data from task execution.
type
(TaskUpdateEventType): The type of eventtask_id
(str): Unique identifier of the associated taskorganization_id
(str): Organization identifiertime
(datetime): Timestamp when the event occurreddata
(Union[Task, ToolCallRequest, ToolCallResult]): Event-specific data payload
ToolCallRequest
Tool invocation request event data.
request_id
(str): Unique identifier for this specific requestoperation_id
(str): Unique identifier for the operationtool_call_id
(Optional[str]): Tool call identifiergraph_node_id
(Optional[str]): Graph node identifiertool_name
(Optional[str]): Name of the tool being requestedpayload
(Optional[Any]): Input parameters for the tool
ToolCallResult
Tool invocation result event data.
request_id
(str): Unique identifier for the original requestoperation_id
(str): Unique identifier for the operationtool_call_id
(Optional[str]): Tool call identifiergraph_node_id
(Optional[str]): Graph node identifiertool_name
(Optional[str]): Name of the tool that was executedpayload
(Optional[Any]): Original payload from the requestresult
(Optional[Any]): Result data from the tool executionis_error
(Optional[bool]): Whether the tool execution resulted in an error
ToolInvocationResult
Result of invoking a tool, containing details about the execution outcome.
result
(Any): The actual result data from the tool executionis_success
(bool): Whether the tool execution was successfulerror
(Optional[str]): Error message if execution failedexecution_time
(float): Time taken for execution in seconds
KnowledgeBaseDocumentItem
Represents a document within a knowledge base.
id
(str): Unique identifier for the documentdocument_url
(str): URL where the document was originally locatedadded_at
(datetime): Timestamp when the document was added
KnowledgeBaseSearchResult
Represents a search result from a knowledge base.
content
(str): The matching content from the knowledge basescore
(float): Relevance score for the search result (0.0 to 1.0)
Common Patterns
Type Checking
Status Comparisons
Output Format Selection
Import Patterns
Individual Types
All Types
Specific Module Types
Related Documentation
- [Agents Module](/API reference/agents): Using types with agent operations
- [Tasks Module](/API reference/tasks): Task execution and status types
- [Tools Repository](/API reference/tools): Tool invocation result types
- [Knowledge Bases](/API reference/knowledge): Document and search result types
- [Events Module](/API reference/events): Event streaming types
- [SDK Exceptions](/API reference/exceptions): Error handling types